<template>
  <div class="parentCommnet">
    <parent :parentComment="parentComment.parent" v-if="parentComment.conent" />
    <div class="info">
      <div class="name">{{ parentComment.user.nickname }}</div>
      <div class="data">2小时前</div>
      <div class="reply" @click="sendComment">回复</div>
    </div>
    <div class="mainComment">
      {{ parentComment.content }}
    </div>
  </div>
</template>

<script>
import eventBus from "../../utils/eventBus";
export default {
  name: "parent",
  props: ["parentComment"],
  methods: {
    sendComment() {
      eventBus.$emit("sendMsg", this.parentComment.id);
    },
  },
};
</script>

<style lang="less" scoped>
.parentCommnet {
  border: 1px solid #ccc;
  font-size: 14 /360 * 100vw;
  .info {
    padding: 10px;
    display: flex;
    .data {
      margin-left: 10 /360 * 100vw;
      flex-grow: 1;
    }
  }
  .mainComment {
    padding: 10 /360 * 100vw;
    // color: red;
    color: #888;
  }
}
</style>